# coding:utf-8

from .preprocessor import Preprocessor


class DropDuplicates(Preprocessor):
    keep = "first"

    def __init__(self):
        Preprocessor.__init__(self)
        self.algorithm_name = "去重"
        self.ipynb_template_name = "drop_duplicates-template.ipynb"

    def implent(self): 
        Preprocessor.implent(self)
        self.new_data.drop_duplicates(subset=self.subset, keep=self.keep, inplace=True)

    def prepareIpynbItems(self):
        Preprocessor.prepareIpynbItems(self)
        self.ipynb_items["#keep#"] = self.keep
